package jltx.fragmentpageframework.zihu.adapter;

import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentPagerAdapter;

import java.util.List;

import jltx.fragmentpageframework.zihu.fragment.BaseZhiHuTabFragment;

/**
 * @author jltxseo
 *         Created by junlintianxia on 2017/06/26.
 */

public class ZhiHuMainTabAdapter extends FragmentPagerAdapter{
    private List<BaseZhiHuTabFragment> fragmentList;

    public ZhiHuMainTabAdapter(FragmentManager fm, List<BaseZhiHuTabFragment> fragmentList) {
        super(fm);
        this.fragmentList = fragmentList;
    }

    @Override
    public Fragment getItem(int position) {
        if(fragmentList != null){
            return fragmentList.get(position);
        }
        return null;
    }

    @Override
    public int getCount() {
        int count = 0;
        if(fragmentList != null){
            count = fragmentList.size();
        }
        return count;
    }

}
